<!DOCTYPE html>
<html>
<head>
<title>支付订单</title>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" />

<link rel="stylesheet" type="text/css" href="/css/zhifu.css">
    <link rel="stylesheet" type="text/css" href="/css/wxzf.css">
    <script src="/js/jquery.js"></script>


<script type="text/javascript" src="/js/jquery.min.js"></script>
    <!--移动端专用弹框-->
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/common.js"></script>
<script>
</script>
</head>
<body>

    <div class="header">
        <div class="all_w ">

            <div class="gofh"> <a href="javascript:history.go(-1)"><img src="/images/jt_03.jpg" ></a> </div>
            <div class="ttwenz">
                <h4>确认交易</h4>
                <h5>微信安全支付</h5>
            </div>
        </div>
    </div>

    <div class="wenx_xx">
        <div class="mz">支付金额</div>
        <div class="zhifu_price"><span>￥<span class="zf_price">88.88</span></span></div></div>
    </div>
    <div class="skf_xinf">
        <div class="all_w"> <span class="bt">收款方</span> <span class="fr">驴爸爸官方存款机</span> </div>
    </div>
    <a href="javascript:void(0);" class="ljzf_but all_w">立即支付</a>
    <!--浮动层-->
    <div class="ftc_wzsf">
        <div class="srzfmm_box">
            <div class="qsrzfmm_bt clear_wl">
                <img src="/images/xx_03.jpg" class="tx close fl">
                <img src="/images/jftc_03.png" class="tx fl">
                <span class="fl">请输入支付密码</span></div>
            <div class="zfmmxx_shop">
                <div class="mz">商品金额</div>
                <div class="zhifu_price"><span>￥<span class="zf_price">88.88</span></span></div></div>
            <ul class="mm_box">
                <li></li><li></li><li></li><li></li><li></li><li></li>
            </ul>
        </div>
        <div class="numb_box">
            <div class="xiaq_tb">
                <img src="/images/jftc_14.jpg" height="10"></div>
            <ul class="nub_ggg">
                <li><a href="javascript:void(0);" class="zf_num">1</a></li>
                <li><a href="javascript:void(0);" class="zj_x zf_num">2</a></li>
                <li><a href="javascript:void(0);" class="zf_num">3</a></li>
                <li><a href="javascript:void(0);" class="zf_num">4</a></li>
                <li><a href="javascript:void(0);" class="zj_x zf_num">5</a></li>
                <li><a href="javascript:void(0);" class="zf_num">6</a></li>
                <li><a href="javascript:void(0);" class="zf_num">7</a></li>
                <li><a href="javascript:void(0);" class="zj_x zf_num">8</a></li>
                <li><a href="javascript:void(0);" class="zf_num">9</a></li>
                <li><a href="javascript:void(0);" class="zf_empty">清空</a></li>
                <li><a href="javascript:void(0);" class="zj_x zf_num">0</a></li>
                <li><a href="javascript:void(0);" class="zf_del">删除</a></li>
            </ul>
        </div>
        <div class="hbbj"></div>
    </div>

	<script type="text/javascript">
	$(function(){

        var params = getParams();

        //拿到门票的id
        var ticketId = params.ticketId;

        //拿到门票的张数
        var number = params.number;

        // 获取当前登陆用户信息
        var user = JSON.parse(sessionStorage.getItem("user"));

        //获取总价格
        var totalprices = params.totalprices;

        //拿到当前用户的id
        var userId = user.id;

        //拿到门票价格显示出来
        if (totalprices) {
            //console.log(params.id);
            $("[class='zf_price']").html(totalprices);
        }

		//出现浮动层
		$(".ljzf_but").click(function(){
			$(".ftc_wzsf").show();
		});
		//关闭浮动
		$(".close").click(function(){
			$(".ftc_wzsf").hide();
			$(".mm_box li").removeClass("mmdd");
			$(".mm_box li").attr("data","");
			i = 0;
		});
			//数字显示隐藏
		$(".xiaq_tb").click(function(){
			$(".numb_box").slideUp(500);
		});
		$(".mm_box").click(function(){
			$(".numb_box").slideDown(500);
		});
			//----
		var i = 0;
		$(".nub_ggg li .zf_num").click(function(){
				
			if(i<6){
				$(".mm_box li").eq(i).addClass("mmdd");
				$(".mm_box li").eq(i).attr("data",$(this).text());
				i++
				if (i==6) {
				  setTimeout(function(){
					var data = "";
						$(".mm_box li").each(function(){
						data += $(this).attr("data");
					});
						$.post("/users/tickets", {"user.id" : userId, "ticket.id" : ticketId, totalprices:totalprices, number:number}, function (data) {
						    if(data.success){
                                /*alert("支付成功"+data);*/
                                $(document).dialog({
                                    type:"confirm",
                                    /*titleText:"温馨提示",*/
                                    content:"支付成功!",
                                    buttons:[
                                        {
                                            name:"确认",
                                            callback:function () {
                                                window.location.href="/mine/cg.html?id=" + userId +  "&totalprices=" + totalprices;
                                            }
                                        }
                                    ]
                                })
                            }
                        });

				  },100);
				};
			} 
		});
			
		$(".nub_ggg li .zf_del").click(function(){
			if(i>0){
				i--
				$(".mm_box li").eq(i).removeClass("mmdd");
				$(".mm_box li").eq(i).attr("data","");
			}
		});
	
		$(".nub_ggg li .zf_empty").click(function(){
			$(".mm_box li").removeClass("mmdd");
			$(".mm_box li").attr("data","");
			i = 0;
		});
		 
	});
	</script>

</body>
</html>